import redis


class RedisUtil:
    def __init__(self, host='127.0.0.1', port=6379, db=0):
        self.redis_client = redis.Redis(host=host, port=port, db=db)

    def __getattr__(self, name):
        # 将其他类对 RedisUtil 实例的方法调用委托给 redis_client 对象
        return getattr(self.redis_client, name)


redis_util = RedisUtil()
